package com.simtop.domain;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import org.apache.ibatis.type.Alias;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;

/**
 * @author Administrator
 * @Description 留言
 */
@Data
@Alias("leaveWord")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class LeaveWord extends BaseEntity{

    /**
     * id
     */
    private Long id;

    /**
     * 姓名
     */
    @NotBlank(message = "姓名不能为空")
    private String name;

    /**
     * 电话
     */
    @NotNull(message = "电话不能为空")
    @Size(min = 11, max = 11, message = "手机号码长度不正确")
    private String phone;

    /**
     * 邮箱
     */
    @NotBlank(message = "邮箱不能为空")
    @Email(message = "邮箱格式不正确")
    private String email;

    /**
     * 留言
     */
    @NotBlank(message = "留言不允许为空")
    private String leaveWord;

    /**
     * 提交日期
     */
    private Date createTime;
}
